package com.future.hedongjun.mine.ui;

import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.future.baselib.activity.BaseActivity;
import com.future.baselib.entity.BaseResponse;
import com.future.baselib.entity.DefaultResponse;
import com.future.baselib.http.HttpRequest;
import com.future.hedongjun.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class UserProtocolActivity extends BaseActivity {

    @BindView(R.id.webView)
    WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_protocol);
        ButterKnife.bind(this);
        setTitle("用户协议");
        webView.setWebChromeClient(new WebChromeClient());
        webView.setWebViewClient(new WebViewClient());
        new HttpRequest<DefaultResponse>()
                .with(this)
                .setPath("/api/Common/yhxy")
                .addSuccessListener(new HttpRequest.OnNetworkSuccess() {
                    @Override
                    public void onSuccess(BaseResponse response) {
                        webView.loadData(response.data,"text/html; charset=UTF-8","");
                    }
                }).start(new DefaultResponse());
    }
}
